# -*- coding: utf-8 -*-
import urllib
import sys
import re

url = 'http://unicode.org/Public/UNIDATA/PropertyValueAliases.txt'

lines = urllib.urlopen(url).readlines()

format = re.compile("^gc\\s*;\\s([a-zA-Z]{1,2})\\s*;\\s([a-zA-Z_]+)(?:[^#]+[#](.+))?")
dict = {}

for line in lines: 
    i = format.search(line)
    if i == None:
        continue

    if i.group(3) != None:
        aliases = [s.strip() for s in i.group(3).split('|')]
        dict[i.group(2)] = aliases
        dict[i.group(1)] = aliases
    else:
        dict[i.group(2)] = [i.group(1)]
            

for n in sorted(dict.keys()):
    s = 'addPropertyAlias("' + n + '\", Arrays.asList('
    for p in dict[n]:
        s += '"' + p + '", '
    s = s[:-2]
    s += '));'
    
    print s
